//
//  companionCollectionViewCell.m
//  LT
//
//  Created by dllo on 16/5/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "companionCollectionViewCell.h"
#import "UIImageView+WebCache.h"


#define CELLWIDTH self.contentView.frame.size.width
#define CELLHEIGHT self.contentView.frame.size.height
#define LABELHEIGHT 30

@interface companionCollectionViewCell ()




@end


@implementation companionCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;

}

-(void)createSubViews{

    self.imageView = [[UIImageView alloc]initWithFrame:self.contentView.bounds];
   self.imageView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFFFF,0XD3D3D3);
    [self.contentView addSubview:self.imageView];
    
    self.nameLabel = [[UILabel alloc]initWithFrame:self.contentView.bounds];
    //self.nameLabel.backgroundColor = [UIColor clearColor];
    //self.nameLabel.dk_backgroundColorPicker = DKColorPickerWithRGB(0xFFFFFF,0XD3D3D3);
    self.nameLabel.alpha = 0.5;
    self.nameLabel.numberOfLines = 4;
    self.nameLabel.textColor = [UIColor blackColor];

    [self.contentView addSubview:self.nameLabel];


}

//重写layout方法自动布局
-(void)layoutSubviews{
    [super layoutSubviews];
    
   
    
    self.imageView.frame = self.contentView.bounds;

  self.nameLabel.frame = CGRectMake(12* WIDTHCELL, 80* WIDTHCELL, (CELLWIDTH - 20)* WIDTHCELL, 100* WIDTHCELL);
    
}

-(void)setCompanModel:(companionModel *)companModel{

    _companModel = companModel;
    
    self.nameLabel.text = companModel.title;
    
    self.imageView.image = [UIImage imageNamed:@"shuqian-1"];


}



@end
